package com.huangdada.hfweather.service;

import com.qiniu.common.QiniuException;

import java.io.File;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;

/**
 * @Description: 七牛云实现业务逻辑接口
 * @PROJECT_NAME: hf-weather
 * @CLASS_NAME:
 * @Author: huanglibin
 * @Date: 2020-04-02 20:55
 * @Version: 1.0
 */
public interface OssService {
    /**
     * 以文件的形式上传
     * @param file
     * @param fileName
     * @return
     * @throws QiniuException
     */
    public String uploadFile(File file,String fileName) throws QiniuException;

    /**
     * 以流的形式上传
     * @param inputStream
     * @param fileName
     * @return
     * @throws QiniuException
     */
    public String uploadFile(InputStream inputStream,String fileName) throws QiniuException;

    /**
     * 删除文件
     * @param key
     * @return
     * @throws QiniuException
     */
    public String delete(String key) throws QiniuException;

    /**
     * 下载文件
     * @param id
     * @return
     * @throws UnsupportedEncodingException
     */
    public String downLoadFile(String id) throws UnsupportedEncodingException;
}
